<?php 

namespace api\models;


class Ret{
    public $code;
    public $messages;
    public $data;
    
    public function __construct($code='-1',$messages='',$data=[])
    {
        $this->code = $code;
        $this->messages = $messages;
        $this->data = $data;
    }

    public function json_output()
    {
        $ret['code']=$this->code;
        $ret['mess']=$this->messages;
        $ret['data']=$this->data;
        echo json_encode($ret);
        exit();
    }
}
